<?php

function testlogin($pwd,$mb)
{
	
	session_start();
	require_once("connectMysql/connetMysql.class.php");
	$mobile=$mb;
	$password=$pwd;
	$db=new connetMysql;
	$con=$db->getConnect();
	
	$chk_sql="SELECT * FROM user WHERE UserPhone='".$mobile."'&&Password='".$password."'";		
	mysqli_query($con,$chk_sql);
	$num=mysqli_affected_rows($con);
	if($num==0)
	{
		$con->close(); 
	}
	else 
	{
		$_SESSION["mb"]=$mobile;
		$_SESSION["pwd"]=$password;
		setcookie("mb",$mobile,time() + (60*60*24*7),"/"); 
        setcookie("w", $password,time() + (60*60*24*7),"/");
		$con->close(); 
		
	}
}
?>